(function(){
	setNodeText("reason-text",publicParam.member.reason);
	if (publicParam.member.address==publicParam.address){
        var placeholder = "请输入您的入会理由（至少50字）";
        var div = getNode("reason-text");
		var txt = (publicParam.member.reason?publicParam.member.reason:placeholder);
        div.contentEditable = true;
        div.innerText=txt;
        div.tag = txt;
        div.onclick = function(){
            if (this.innerText == placeholder) this.innerText="";
        }
        div.onblur = function (){
            if (this.tag != this.innerText){
                if(this.innerText.length<50){
                    alert("入会理由至少50个字，现在只有"+this.innerText.length+"个。");
                }else{
                    publicParam.member.reason = this.innerText;
                    var param = {
                        webapi:"updateMemberReason",
                        reason:(publicParam.member.reason?publicParam.member.reason:""),
                    }
                    callAPI(param);
                }
            }
        };
        if (this.innerText=="") this.innerText=placeholder;
    }
})();